<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>${title}</title>
<%@include file="/WEB-INF/templates/common/common.jsp"%>

<script  type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
</head>
<body>
 <!--头部-->
 <%@include file="/WEB-INF/templates/common/header.jsp"%>

<!------导航条-->
 <%@include file="/WEB-INF/templates/common/navigation.jsp"%>
<div class="list_main lay_out">
 <div class="list_DH">
   <!--打印模块导航栏-->
 <%@include file="/WEB-INF/templates/common/printnav.jsp"%>
 </div>
 <div class="list_NR">
  <div class="loc">
   <h3>病案打印</h3>

  </div>
  <div class="list_con_table"> 
   <div class="search_table">
    <ul> 
   <form style="height:114px" action="${basePath}/print/addPrintMsg"  id="printForm" method="post">
     <input type="hidden" name="id" id="printDetailId" value="${printDetail.id}"> 
      <input type="hidden" name="printId" value="${printDetail.printId}"> 
      <input type="hidden" name="printStatus" value="${printDetail.printStatus}"> 
      <input type="hidden" name="applyReason" id="applyReason" value="${printDetail.printCopies}"> 
    <input type="hidden" name="medicalRecord" id="medicalRecord" value="${printDetail.medicalRecord}"> 
    <input type="hidden" id="medicalOnlyId" name="medicalOnlyId" value="${printDetail.medicalOnlyId}"> 
    <li class="Label_1" style="width:14%">病案所属人姓名：&nbsp;</li>
    <li class="Label_2" style="width:18%"><input class="input_box" type="text" maxlength="10"  id='patientName' value='${printDetail.patientName}' /></li>
    <li class="Label_1" >所属人身份证：</li>
    <li class="Label_2"><input class="input_box" type="text" maxlength="20" id='patientCard' value='${printDetail.patientCard}' /></li>
    <li class="Label_1">诊疗记录标示：&nbsp;</li>
    <li class="Label_2"><input class="input_box" type="text" maxlength="11" id='medicalRecord' value='${printDetail.medicalRecord}' /></li>
    <li class="Label_1" style="width:14%">打印页数：</li>
    <li class="Label_2" style="width:18%"><input class="input_box" type="text" maxlength="3" name='printPagination' id='page' value='' /></li>
    <li class="Label_1">打印费用：&nbsp;</li>
    <li class="Label_2"><input type="text"  name="printFee"  maxlength="7"
					class="input_box" id="printFee"/></li>
	  <li class="Label_1">打印时间：&nbsp;</li>
    <li class="Label_2"><input type="text" id="printTime"  name="printTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
					class="input_box"/></li>
	 <li class="Label_5" style="width:100%">
	 	<a onclick="submitForm()"/>保存</a>&nbsp;
	 </li>

    </form>
    </ul>
   </div>
  </div>
 	
 </div>
</div>
<!--页脚部分-->
 <%@include file="/WEB-INF/templates/common/footer.jsp"%>
 <script>
 window.onload = function(){
	 var medicalOnlyId=$("#medicalOnlyId").val();
	 var applyReason=$("#applyReason").val();
	 var printDetailId=$("#printDetailId").val();
	 var medicalRecord=$("#medicalRecord").val();
	 //alert(applyReason+"--"+medicalOnlyId);
	 openPrint(medicalOnlyId,applyReason);
 }

 	
 	function openPrint(medicalOnlyId,applyReason){
  		window.open("${basePath}/print/printPic?medicalOnlyId="+medicalOnlyId+"&applyReason="+applyReason+"",
 				'_blank',
 				"toolbar=yes,resizable=1, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=800, height=600"); 
 	}
 	
 	
 	var numReg =  /^[0-9]+.?[0-9]*$/;
 	var nReg= /^[0-9]*/;
 	function submitForm(){
 		
 		var page=$("#page").val();
 		if(page==null || page==""){
 			alert("打印页数不能为空!");
 			return;
 		}else{
 			if(!numReg.test(page)){
  				alert("页数输入格式不正确!");
  				return;
  			}
 		}
 		
 		var printFee=$("#printFee").val();
 		if(printFee==null || printFee==""){
 			alert("打印费用不能为空!");
 			return;
 		}else{
 			 if(!numReg.test(printFee)){
  				alert("金额输入格式不正确!");
  				return;
  			}
 		}
 		
 		
 		
 		
 		var printFee=$("#printFee").val();
 		if(printFee==null || printFee==""){
 			alert("打印费用不能为空!");
 			return;
 		}else{
 			 if(!numReg.test(printFee)){
  				alert("金额输入格式不正确!");
  				return;
  			}
 		}
 		
 		var printTime=$("#printTime").val();
 		if(printTime==null || printTime==""){
 			alert("时间不能为空!");
 			return;
 		}
 		
 		$("#printForm").submit();
 		
 	}
 	

 
 </script>
</body>
</html>
